<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        new Promise((resolve,reject)=>{
            setTimeout(()=>{
                // resolve('111')
                reject('1111')//调用reject会直接跳到reject方法
            },1000)
        }).then(data=>{
            console.log(data)
            return Promise((resolve,reject)=>{
                setTimeout(()=>{
                    resolve('222')
                },1000)
            })
        }).catch(err=>{
            console.log(err)
        })
    </script>
</body>
</html>